; > $.PerKbSW.Hdr.Hardware

; Bits in TCON (Timer/Counter Control Register)

TF1     Bit     TCON, 7
TR1     Bit     TCON, 6
TF0     Bit     TCON, 5
TR0     Bit     TCON, 4
IE1     Bit     TCON, 3
IT1     Bit     TCON, 2
IE0     Bit     TCON, 1
IT0     Bit     TCON, 0

; Bits in SCON (Serial Port Control Register)

SM0     Bit     SCON, 7
SM1     Bit     SCON, 6
SM2     Bit     SCON, 5
REN     Bit     SCON, 4
TB8     Bit     SCON, 3
RB8     Bit     SCON, 2
TI      Bit     SCON, 1
RI      Bit     SCON, 0

; Bits in IE (Interrupt Enable Register)

EA      Bit     IE, 7
ES      Bit     IE, 4
ET1     Bit     IE, 3
EX1     Bit     IE, 2
ET0     Bit     IE, 1
EX0     Bit     IE, 0

; Bits in PI (Interrupt Piority Register)

PS      Bit     IP, 4
PT1     Bit     IP, 3
PX1     Bit     IP, 2
PT0     Bit     IP, 1
PX0     Bit     IP, 0

Port0           *       P0      ; Port zero - all bits for reset only
Port1           *       P1      ; input from main key matrix

MouseInput      *       P2      ;Mouse quadrature input
MouseMask       *       &F0     ;Mouse quadrature on top four bits

MatrixOutput    *       P2      ;Bottom four bits are encoded column


SerialDataIn    Bit     P3, 0   ; but not needed as the chip gives us a byte
SerialDataOut   Bit     P3, 1   ; ditto
LCD20           Bit     P0, 0   ;LCD 20% segment etc
LCD40           Bit     P0, 1
LCD60           Bit     P0, 2
LCD80           Bit     P0, 3
LCD100          Bit     P0, 4
CapsLockLED     Bit     P0, 5
ScrollLockLED   Bit     P0, 7
NumLockLED      Bit     P0, 6
MouseButton1    Bit     P3, 5
MouseButton2    Bit     P3, 6
MouseButton3    Bit     P3, 7
MouseButtonInput *      P3
MouseButtonMask  *      &E0
MouseButtonShift *      5       ; mouse key info starts at bit 5
LEDMask          *      &E0

Display          *      P0      ;4 character display for debug
CharSel          *      P2      ;character select address o/p
WrStrobe        Bit     P3, 6   ;display write strobe
FNLED           Bit     P3, 4   ;FN mode LED
PC_Clock        Bit     P3, 3   ;PC Keyboard clock
PC_Data         Bit     P3, 2   ;PC Keyboard data
HostReset       Bit     P0, 4   ;Host Main reset line
blip            Bit     P0, 0   ;for debug only
;Battery LCD status indicator on bottom 5 bits of port 0 (P0<0> thru' P0<4>)

        END
